
local skynet = require("skynet")
local server_name = skynet.getenv("server_name")
local server_path = skynet.getenv("root") --server所在目录






local Config = {}

--写日志到目录
Config.log_path = "/home/logs/"
--配置文件目录
Config.config_path = server_path.."/config" --"/data/config"  
--.pb文件所在目录 
Config.pb_path = server_path.."protocol/pb" 


--redis相关配置
Config.redis = {
	host = "127.0.0.1",
	port = 6379,
	password = "",
	db_id = 0,
}
--mysql配置
Config.mysql = {
	host = "127.0.0.1",
	port = 3306,
	database = "test",
	user = "root",
	password = "",	
}
--mongo配置
Config.mongo = {
	host = "127.0.0.1",
	port = 21717,
	database = "test",
	user = nil,
	password = nil,	
}

--节点配置
local node_info = {
	nodeserver = {
		id = 1,
		name = "nodeserver",
		type = "nodeserver",		
		cluster_ip = "127.0.0.1",
		cluster_port = 60010, --集群端口
		debug_port = 60011, --控制台端口
		enable = true, --可用
	},
	gateserver = {
		id = 2,
		name = "gateserver",
		type = "gateserver",		
		cluster_ip = "127.0.0.1",
		cluster_port = 60020,
		debug_port = 60021,
		client_port = 60022,
		enable = true, --可用
	},	
	dbserver = {
		id = 3,
		name = "dbserver",
		type = "dbserver",		
		cluster_ip = "127.0.0.1",
		cluster_port = 60030,
		debug_port = 60031,
		enable = true, --可用
	},	
	accountserver = {
		id = 4,
		name = "accountserver",
		type = "accountserver",		
		cluster_ip = "127.0.0.1",
		cluster_port = 60040,
		debug_port = 60041,
		enable = true, --可用
	},	
	hallserver = {
		id = 5,
		name = "hallserver",
		type = "hallserver",		
		cluster_ip = "127.0.0.1",
		cluster_port = 60050,
		debug_port = 60051,
		enable = true, --可用
	},
	gameserver = {
		id = 6,
		name = "gameserver",
		type = "gameserver",		
		cluster_ip = "127.0.0.1",
		cluster_port = 60060,
		debug_port = 60061,
		enable = true, --可用
	},	

	testserver = {
		id = 7,
		name = "testserver",
		type = "testserver",		
		cluster_ip = "127.0.0.1",
		cluster_port = 60100,
		debug_port = 60101,
		enable = false, --可用
	},	
}
Config.node_info = node_info[server_name]



return Config